<template>
  <div class="ouats">
    <div class="ouat">
      <div class="nav_spj">
        <span>平价</span>
        <span>租车</span>
        <span>At Par</span>
      </div>

      <van-form @submit="submitForm">
        <van-field
                v-model="param.username"
                name="用户名"
                label="用户名"
                placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]"
        />
        <van-field
                v-model="param.password"
                type="password"
                name="密码"
                label="密码"
                placeholder="密码"
                :rules="[{ required: true, message: '请填写密码' }]"
        />
        <div style="margin: 16px;">
          <van-button round block type="info" native-type="submit">登陆</van-button>
        </div>
      </van-form>


<!--      <div class="denglu">-->
<!--      <van-button type="info" size="small" @click="register_()" round="false" text="注册"></van-button>-->
<!--      <van-button type="info" size="small" @click="pwdback_()" round="false" text="忘记密码"></van-button>-->
<!--      </div>-->
      <div class="denglu">
        <div>
          <span @click="register_()">注册</span>
          <span @click="pwdback_()">忘记密码</span>
        </div>
      </div>
    </div>
    <div class="flass">
      <img src="../../assets/register/denglubj.png" alt="" />
      <div class="bottom">
        <p>登陆及表示您同意<span>《平价驻车用户隐私协议》</span></p>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Toast } from "vant";
import { Form } from 'vant';
import { Field } from 'vant';
import {login} from '../../request/login_register/login_register';
Vue.use(Toast);
Vue.use(Form);
Vue.use(Field);
export default {
  props: {},
  mounted() {

  },
  data() {
    return {
      bluck: "#0c67f9",
      flasc: false,
      loading: false,
      pas: "password",
      tex: "text",
      param: {
        username: 'admin',
        password: '123456',
        code: '',
      },
      textz: "15700085997",
      passwor: "123456",
      pohoot: /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/,
      mima: /^\w{6,12}$/,
    };
  },
  methods: {
    submitForm() {
      this.$http.post("/login1?username=" + this.param.username + "&password=" + this.param.password).then(resp => {
        if (resp.data.code === 200) {
          this.$message.success('登录成功');
          localStorage.setItem('token', resp.data.data);
          localStorage.setItem('ms_username', this.param.username);
          localStorage.setItem("ms_id", this.param.id)
          this.$router.push('/banner');
        } else {
          this.$message.error('登陆失败');
          this.loading = false;
        }
      })
    },
      dianqi()
      {
        this.flasc = !this.flasc;
      }
    ,
      register_()
      {
        this.$router.push("/register");
      }
    ,
      pwdback_()
      {
        this.$router.push("/pwdback");
      }
    ,
      ccd()
      {
        this.$router.push('/banner')
      }
    ,
    }
  }
</script>

<style scoped lang="less">
.ouats {
  height: 100%;
}
.ouat {
  font-size: 0.2rem;
  margin: 0 0.24rem;
  display: flex;
  flex-direction: column;
}
.nav_spj {
  height: 3.22rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.4684rem;
  color: #0c67f9;
  font-weight: bolder;
  & > span:last-child {
    font-size: 0.4275rem;
  }
}
.zhanhao {
  margin: 0.7rem 0;
  font-size: 0.28rem;
  height: 2.08rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  & > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .zhanh > input {
    height: 0.86rem;
    padding: 0 0.19rem;
    width: 5.5rem;
    font-size: 0.24rem;
    color: #999999;
    border-radius: 0.05rem;
    border: none;
    border: 2px solid #e7e7e7;
  }
  .inputs {
    border: 2px solid #e7e7e7;
    height: 0.86rem;
    padding: 0 0.19rem;
    width: 5.5rem;
    font-size: 0.24rem;
    color: #999999;
    border-radius: 0.05rem;
    display: flex;
    align-items: center;
    & > input {
      flex: 1;
      border: none;
      height: 0.8rem;
    }
    & > .van-icon-eye-o {
      font-size: 0.35rem;
    }
  }
  label {
    font-weight: 900;
  }
}
.denglu {
  margin: 0.72rem 0 1.19rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 1.45rem;
  .denlb {
    background-color: #42a2fe;
    border-radius: 0.08rem;
    height: 1rem;
    text-align: center;
    line-height: 1rem;
    flex-direction: column;
  }
  & > div {
    display: flex;
    color: white;
    font-size: 0.36rem;
    justify-content: space-between;
    width: 100%;
    span {
      font-size: 0.28rem;
      color: #3d88f7;
    }
  }
}
.flass {
  position: relative;
  bottom: 0;
  height: 2.9rem;
  & > img {
    width: 3.86rem;
    height: 2.04rem;
    z-index: 5;
    position: absolute;
    top: 0;
    right: 0;
  }
}
.bottom {
  background-color: #e9f1ff;
  height: 1.95rem;
  width: 100%;
  position: absolute;
  bottom: -.37rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  & > p {
    z-index: 7;
    margin-bottom: 0.5rem;
    color: #bcbcbc;
    font-size: 0.2rem;
    text-align: center;
    & > span {
      color: #0c67f9;
    }
  }
}
</style>
